package com.ruoyi.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.enums.DelFlag;
import com.ruoyi.system.domain.HuoPinPinLei;
import com.ruoyi.system.mapper.HuoPinPinLeiMapper;
import com.ruoyi.system.service.IHuoPinPinLeiService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 货品品类 服务实现类
 * </p>
 *
 * @author qubaofeng
 * @since 2025-02-11
 */
@Service
public class HuoPinPinLeiServiceImpl extends ServiceImpl<HuoPinPinLeiMapper, HuoPinPinLei> implements IHuoPinPinLeiService {

    @Override
    public List<HuoPinPinLei> selectWithPage(HuoPinPinLei user) {
        return baseMapper.selectWithPage(user);
    }

    @Override
    public List<HuoPinPinLei> selectAll(HuoPinPinLei sp) {
        LambdaQueryWrapper<HuoPinPinLei> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(sp.getCangKuId()!=null, HuoPinPinLei::getCangKuId, sp.getCangKuId());
        wrapper.eq(HuoPinPinLei::getDelFlag, DelFlag.NOMAL.getCode());
        return baseMapper.selectList(wrapper);
    }


}
